package com.base.common.persistent.dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.base.common.persistent.model.TicketReport;
import com.cjy.common.annotation.MyBatisRepository;

/**
 * 工单进度dao
 * 
 * @author Kevin Colin
 *
 */

@MyBatisRepository
public interface TicketReportMapper {

	/**
	 * 添加工单进度记录
	 * 
	 * @param ticketReport
	 * @return
	 */
	int addTicketReport(TicketReport ticketReport);

	/**
	 * 根据工单id和工单进度状态查询当前工单进度信息
	 * 
	 * @param ticketId
	 * @return
	 */
	List<TicketReport> queryTicketReportByticketIdAndReportStatus(
			@Param(value = "ticketId") int ticketId,
			@Param(value = "status") int status);

	/**
	 * 根据工单id和工单记录状态和工单记录类别查询工单记录信息
	 * 
	 * @param ticketId
	 * @param status
	 * @param categories
	 * @return
	 */
	List<TicketReport> queryTicketReportByTicketIdAndReportStatusAndReportCategories(
			@Param(value = "ticketId") int ticketId,
			@Param(value = "status") int status,
			@Param(value = "categories") int categories);

	/**
	 * 根据id更新状态
	 * 
	 * @param id
	 * @return
	 */
	int udpateStatusById(@Param(value = "id") int id,
						 @Param(value = "status") int status);

	/**
	 * 根据id更新记录信息
	 * 
	 * @param ticketReport
	 * @return
	 */
	int updateReportById(TicketReport ticketReport);

	int  updateReturnVisitScoreById(@Param(value = "id") int id, @Param(value = "returnVisitScore") int returnVisitScore);
}
